﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ContosoUniversity.Models
{
    public enum Grade
    {
        A, B, C, D, F
    }

    public class Enrollment
    {
        public int EnrollmentID { get; set; }
        public int CourseID { get; set; }
        public int StudentID { get; set; }
        [DisplayFormat(NullDisplayText = "No grade")]
        public Grade? Grade { get; set; }

        //注册记录面向一门课程，因此存在 CourseID 外键属性和 Course 导航属性
        public Course Course { get; set; }

        //注册记录面向一名学生，因此存在 StudentID 外键属性和 Student 导航属性
        public Student Student { get; set; }
    }
}